using UnityEngine;

namespace MicFarm.Inventory
{
    public class ItemPickUp : MonoBehaviour
    {
        void OnTriggerEnter2D(Collider2D other)
        {
            Item item = other.GetComponent<Item>();

            if (item != null)
            {
                Debug.Log(item.itemDetails.name);
                if (item.itemDetails.canPickedUp)
                {
                    InventoryManager.Instance.AddItem(item, true);
                }
            }
        }
    }    
}

